package com.diandian.backend.dingding.data.mapper;

import com.diandian.backend.dingding.data.domain.DingdingDeptTree;
import com.diandian.backend.dingding.data.domain.DingdingDeptTreeQuery;
import com.diandian.backend.dingding.data.dto.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface DingdingDeptTreeMapper {

    // 查询记录数
    Integer getCount(@Param("data") DingdingDeptTreePageParamDTO requestDTO);

    // 查询分页中的数据集合
    List<DingdingDeptTree> getPage(@Param("data") DingdingDeptTreePageParamDTO requestDTO, @Param("pageSize") Integer pageSize, @Param("offset") Integer offset);

    // 查询详情
    DingdingDeptTree getDetail(@Param("data") DingdingDeptTreeDetailParamDTO requestDTO);

    // 根据数据id更新记录
    void updateById(@Param("data") DingdingDeptTreeUpdateByIdParamDTO param);

    // 根据数据id删除记录
    void deleteById(@Param("data") DingdingDeptTreeDeleteByIdParamDTO param);

    void deleteByBelong(@Param("belong") String belong);

    // 新增
    void add(@Param("data") DingdingDeptTreeAddParamDTO param);

    void batchAdd(@Param("dataList") List<DingdingDeptTreeAddParamDTO> dataList);

    // 查询数据集合
    List<DingdingDeptTree> getList(@Param("data") DingdingDeptTreeListParamDTO requestDTO);

    List<DingdingDeptTree> getDeepListByCode(@Param("belong") String belong, @Param("deptCode") String deptCode);

    List<DingdingDeptTreeQuery> getTreeList(@Param("data") DingdingDeptTreeListParamDTO requestDTO);

}